/**
 * 
 */
package com.gpms.action.base;

import com.gpms.bean.Teacher;
import com.gpms.service.systemInit.IAdminOperateFactory;
import com.gpms.service.systemInit.ITeamService;
import com.gpms.service.systemInit.TeamFactory;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author laborc
 *
 */
public class TeacherAction extends ActionSupport 
{
	private String teacherID;
	private Teacher teacher;
	public String getTeacherID() {
		return teacherID;
	}

	public void setTeacherID(String teacherID) {
		this.teacherID = teacherID;
	}
	
	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		if("".equals(getTeacherID()))
		{
			return LOGIN;
		}else{
			Teacher teacher=new Teacher();
			teacher.setTeacherNum(getTeacherID());
			System.out.println(getTeacherID());
			IAdminOperateFactory factory=new TeamFactory();
			ITeamService its = (ITeamService)factory.create("2");
			teacher = its.showMember(teacher);
			setTeacher(teacher);
			return SUCCESS;
		}
	}

	
}
